{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4d6851e2-115f-41fc-8101-2545de023aa2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3*4的原数组: \n",
      " [[ 8 30  7 91]\n",
      " [86  4 13 28]\n",
      " [96 60 91 22]]\n",
      "转置后4*3的数组: \n",
      " [[ 8 86 96]\n",
      " [30  4 60]\n",
      " [ 7 13 91]\n",
      " [91 28 22]]\n",
      "变形后2*6的数组: \n",
      " [[ 8 30  7 91 86  4]\n",
      " [13 28 96 60 91 22]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "arr = np.random.randint(1,100,size=(3,4))\n",
    "print('3*4的原数组: \\n', arr)\n",
    "print('转置后4*3的数组: \\n', arr.T)\n",
    "print('变形后2*6的数组: \\n', arr.reshape(2,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "96cd86ad-18f4-417f-87d7-ccb2f5883e3f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
